
// 新增页面表单编辑后事件

import afterEditForm from '../request/afterEditForm';

export default async function(props, moduleId, key, value, oldValue, func_type = '2') {
    const {
        humanResourceOrganizationValue: {
            refpk
        },
        form: {
            getAllFormValue,
            setAllFormValue
        }
    } = this.props;

    let postData = {
        areaCode: moduleId,
        func_type: func_type,
        key: key,
        model: getAllFormValue(moduleId),
        pk_org: refpk
    };

    try {
        let res = await afterEditForm(postData);
        let formData = res.data.formData[moduleId];

        setAllFormValue({
            [moduleId]: formData
        });
    }
    catch(e) {
    }
}
